font button: Use GtkWindow::hide-on-close
authorMatthias Clasen <mclasen@redhat.com>
Sun, 31 Dec 2017 15:43:01 +0000 (10:43 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 16 Jan 2018 19:14:09 +0000 (14:14 -0500)
Instead of the ::delete-event signal.

gtk/gtkfontbutton.c

index ce3255f2a85062b68cae26da79ebe687a26f2b3b..8930585ad703ea24f5b79035cbdd52237bfaf255 100644 (file)
@@ -931,6 +931,8 @@ gtk_font_button_clicked (GtkButton *button,
       parent = gtk_widget_get_toplevel (GTK_WIDGET (font_button));
 
       priv->font_dialog = gtk_font_chooser_dialog_new (priv->title, NULL);
+      gtk_window_set_hide_on_close (GTK_WINDOW (priv->font_dialog), TRUE);
+
       font_dialog = GTK_FONT_CHOOSER (font_button->priv->font_dialog);
 
       if (priv->font_map)
@@ -974,16 +976,13 @@ gtk_font_button_clicked (GtkButton *button,
 
       g_signal_connect (font_dialog, "destroy",
                         G_CALLBACK (dialog_destroy), font_button);
-
-      g_signal_connect (font_dialog, "delete-event",
-                        G_CALLBACK (gtk_widget_hide_on_delete), NULL);
     }
-  
+
   if (!gtk_widget_get_visible (font_button->priv->font_dialog))
     {
       font_dialog = GTK_FONT_CHOOSER (font_button->priv->font_dialog);
       gtk_font_chooser_set_font_desc (font_dialog, font_button->priv->font_desc);
-    } 
+    }
 
   gtk_window_present (GTK_WINDOW (font_button->priv->font_dialog));
 }